package com.lihaogn.sell.service;

import com.lihaogn.sell.entity.FoodCookCategory;
import com.lihaogn.sell.entity.FoodMaterial;
import com.lihaogn.sell.entity.FoodTypeCategory;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @FileName: ProductCategoryService
 * @Description: TODO
 * @Author: lihao
 * @Date: 2019-05-16 16:48
 * @Version: 1.0
 */
public interface ProductCategoryService {

    // ================ 查询操作 ================

    /**
     * 查询所有的食材信息
     * @return
     */
    List<FoodMaterial> getAllFoodMaterial();

    /**
     * 根据id查询食材
     * @param foodMaterialTempId
     * @return
     */
    FoodMaterial queryFoodMaterialById(int foodMaterialTempId);

    /**
     * 根据id查询cookCategory
     * @param categoryId
     * @return
     */
    FoodTypeCategory queryFoodTypeCategoryById(String categoryId);

    /**
     * 根据id查询cookCategory
     * @param categoryId
     * @return
     */
    FoodCookCategory queryFoodCookCategoryById(String categoryId);

    /**
     * 获取所有的cook分类信息
     * @return
     */
    List<FoodCookCategory> getAllFoodCookCategory();

    /**
     * 获取所有的type分类记录
     * @return
     */
    List<FoodTypeCategory> getAllFoodTypeCategory();

    /**
     * 查询cook分类name是否已经存在
     * @param cookName
     * @return
     */
    int queryExistCookName(String cookName);

    /**
     * 查询type分类name是否已经存在
     * @param typeName
     * @return
     */
    int queryExistTypeName(String typeName);

    /**
     * 查询食材名称是否已经存在
     * @param name
     * @return
     */
    Integer queryExistMaterialName(String name);

    // ================ 插入操作 ================

    int addOneFoodCookCategory(FoodCookCategory foodCookCategory);

    int addOneFoodTypeCategory(FoodTypeCategory foodTypeCategory);

    /**
     * 添加一个食材类别
     * @param foodMaterial 食材对象
     * @return 修改记录条数
     */
    int addFoodMaterial(FoodMaterial foodMaterial);

    // ================ 更新操作 ================

    int updateOneFoodCookCategory(FoodCookCategory foodCookCategory);

    int updateOneFoodTypeCategory(FoodTypeCategory foodTypeCategory);

    int updateFoodMaterial(FoodMaterial foodMaterial);

    // ================ 删除操作 ================

    int deleteOneFoodCookCategory(String foodCookCategoryId);

    int deleteOneFoodTypeCategory(String foodTypeCategoryId);

    /**
     * 删除单个食材记录
     * @param materialId
     * @return
     */
    int deleteOneFoodMaterial(int materialId);

    int deleteMultiFoodCookCategory(HttpServletRequest request);

    int deleteMultiFoodTypeCategory(HttpServletRequest request);

    /**
     * 删除多条食材记录
     * @param request
     * @return
     */
    int deleteMultiFoodMaterial(HttpServletRequest request);
}
